Method for resource allocation and apparatus

ABSTRACT

A method for resource allocation and an apparatus in a communication device are provided. The method includes that: a sidelink logical channel with high priority is selected from sidelink logical channels belonging to a target address, where the priority of the logical channel is associated with a ProSe Per Packet Priority (PPPP) and the logical channel with high priority is associated with high PPPP; resources are allocated for data in the sidelink logical channel with the high priority; and data transmission is performed between UEs based on the allocated resources.

CROSS-REFERENCE TO RELATED APPLICATION

This is a continuation application of International Application No.PCT/CN2018/079188 filed on Mar. 15, 2018, the contents of which arehereby incorporated by reference in its entirety.

TECHNICAL FIELD

The present invention relates to the field of information processingtechnologies, and in particular, to a method for resource allocation andan apparatus in a communication device.

RELATED ART

An Internet of Vehicles system is a sidelink (SL) transmissiontechnology based on LTE-D2D, and has higher spectral efficiency and alower transmission delay. In 3GPP Rel-14, an Internet of Vehiclestechnology (V2X) is standardized, and two transmission modes, namely, amode 3 and a mode 4, are defined. In the mode 4, a vehicle terminal usesa sensing+reservation transmission manner. The vehicle terminal obtainsan available transmission resource set in a resource pool throughsensing. The terminal randomly selects a resource from the set totransmit data. In Rel-15, eV2X is extended to a multicarrier scenario,that is, UE may simultaneously receive and transmit data on more thanone carrier. This leads to a problem of how to perform carrierselection.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a schematic flowchart of a carrier selection method accordingto an embodiment of the present invention;

FIG. 2 is a schematic flowchart of a carrier selection method accordingto an embodiment of the present invention;

FIG. 3 is a schematic structural composition diagram of UE according toan embodiment of the present invention;

FIG. 4 is a schematic diagram of a scenario according to an embodimentof the present invention; and

FIG. 5 is a schematic diagram of a hardware architecture according to anembodiment of the present invention.

DETAILED DESCRIPTION

To understand features and technical content of embodiments of thepresent invention in more detail, the following describesimplementations of the embodiments of the present invention in detailwith reference to the accompanying drawings. The accompanying drawingsare merely for reference and description, and are not intended to limitthe embodiments of the present invention.

Embodiments of the present invention provide a carrier selection method,UE, and a computer storage medium.

A carrier selection method provided in an embodiment of the presentinvention is applied to UE, and the method includes:

selecting, for target data, a resource on a target carrier according toa first preset criterion, where the first preset criterion includes atleast: preferentially selecting the resource for high-priority targetdata; and

performing data transmission between UEs based on the selected resourceof the target carrier.

UE provided in an embodiment of the present invention includes:

a processing unit, configured to select, for target data, a resource ona target carrier according to a first preset criterion, where the firstpreset criterion includes at least: preferentially selecting theresource for high-priority target data; and

a communications unit, configured to perform data transmission betweenUEs based on the selected resource of the target carrier.

UE provided in an embodiment of the present invention includes: aprocessor and a memory configured to store a computer program executableon the processor, where

the processor is configured to perform the steps of the foregoing methodwhen running the computer program.

A computer storage medium provided in an embodiment of the presentinvention stores a computer executable instruction, and when executed,the computer executable instruction implements the steps of theforegoing method.

In the technical solutions of the embodiments of the present invention,resource selection can be performed for target data according to apriority of the target data, and then data transmission between UEs isperformed on a selected resource of a carrier. In this way, a problem ofhow to receive and transmit data when UE performs multi-carrier datatransmission can be resolved.

Embodiment 1

This embodiment of the present invention provides a carrier selectionmethod, applied to UE. As shown in FIG. 1, the method includes thefollowing steps:

Step 101: Select, for target data, a resource on a target carrieraccording to a first preset criterion, where the first preset criterionincludes at least: preferentially selecting the resource forhigh-priority target data.

Step 102: Perform data transmission between UEs based on the selectedresource of the target carrier.

There may be at least one piece of target data. That is, there may be aplurality of pieces of target data, and a quantity of the target data isnot described in detail herein.

Further, a manner of determining a priority of the target data mayinclude at least one of the following:

for two logical channels for which a PDCP copy operation is performed,data of a first logical channel is used as higher-priority data, anddata of a second logical channel is used as lower-priority data;

data corresponding a target address including a logical channelassociated with a high data packet priority (ProSe per packet priority(PPPP)) has a high priority; and

at the target address, data corresponding to the logical channelassociated with the high data packet priority PPPP has a high priority.

Specifically, the high priority may be represented by using a PPPP, thatis, a lower PPPP value represents a higher priority.

The high priority may be represented by using copying/non-copying data.That is, for a specific bearer for performing a PDCP copy operation(that is, the bearer is divided into two logical channels, serving twoPDCP PDU copies of the bearer). Only after to-be-transmitted data of onelogical channel is completely allocated, data is allocated to the otherlogical channel. The UE determines a first logical channel and a secondlogical channel in the two logical channels. Priorities of the twological channels may be determined according to whether there isto-be-transmitted data in a logical channel. For example, a logicalchannel in which there is to-be-transmitted data may be defined as ahigh-priority logical channel; otherwise, defined as a low-prioritylogical channel.

That is, after a user allocates a first carrier set to to-be-transmitteddata of one logical channel having a high priority, the user mayallocate, from carriers outside the first carrier set, a carrier toto-be-transmitted data of the other logical channel having a lowpriority.

That the target address of a high-priority logical channel correspondsto high-priority data may be determined according to priorities ofdifferent target addresses. In addition, at each target address, theremay be logical channels having different priorities. A priority oftarget data is determined based on a priority of a logical channel.

In that data corresponding a target address including a logical channelassociated with a high data packet priority PPPP has a high priority, alogical channel associated with a data packet priority means that eachlogical channel is associated with one data packet priority value PPPP.Such an association relationship is determined by the UE, and differentlogical channels may be associated with a same PPPP. The high datapacket priority PPPP means that a lower PPPP value represents a higherpriority.

When carrier selection is performed, a carrier is selected according toa particular condition. The first preset criterion further includes atleast one of the following:

a Channel Busy Ratio (CBR) measurement value of the target carrier beingless than a threshold;

the target carrier being capable of carrying a data packet priority PPPPvalue of the target data;

the target carrier being capable of carrying a service of the targetdata;

a CBR value of the target carrier being less than a current CBRmeasurement value and a CBR threshold corresponding to the data packetpriority PPPP value of the current target data; and a quantity ofresource grants on the target carrier being less than a resource grantquantity threshold.

Certainly, there may be other criteria, which are not enumerated in thisembodiment.

Further, during the selecting a resource on a target carrier accordingto a first preset criterion, the method further includes:

selecting, for low-priority data, a first resource on a first carrier,and subsequently selecting, for high-priority data, a second resource ona second carrier.

Correspondingly, the method further includes: determining whether thefirst resource and the second resource are in conflict; and

if the second resource is in conflict with the first resource,preferentially transmitting the second resource, and discarding thefirst resource.

That is, a sequence of resource allocation performed on high-priority orlow-priority target data may be set according to an actual situation.The manner described above is a manner in which the low-priority data isallocated a resource first and then the high-priority data is allocateda resource. In this manner, whether the two resources are in conflictneeds to be further determined. If the two resources are in conflict, alow-priority resource needs to be discarded, and a high-priorityresource is transmitted.

Another manner is: selecting, for high-priority data, a first resourceon a first carrier, and subsequently selecting, for low-priority data, asecond resource on a second carrier that is not in conflict with thefirst resource on the first carrier.

A method for determining whether the resources are in conflict mayinclude at least one of the following:

when the first resource on the first carrier and the second resource onthe second carrier are in a same position in time domain, and the firstcarrier and the second carrier are different, if a terminal device has amulticarrier sending capability, and the multicarrier sending capabilitysupports a band combination of the first carrier and the second carrier,determining that the first resource and the second resource are not inconflict;

when the first resource on the first carrier and the second resource onthe second carrier are in different positions in time domain, and thefirst carrier and the second carrier are different, if a time intervalbetween the first resource on the first carrier and the second resourceon the second carrier is greater than a preset time threshold,determining that the first resource and the second resource are not inconflict; and when the first resource on the first carrier and thesecond resource on the second carrier are on a same carrier, and atime-frequency resource of the first resource on the first carrier and atime-frequency resource of the second resource on the second carriermeet a preset peak-to-average ratio requirement, determining that thefirst resource and the second resource are not in conflict.

For example, assuming that the first resource is a resource grant 1, andthe second resource is a resource grant 2, if a time-frequency resourceof the resource grant 1 and a time-frequency resource of the resourcegrant 2 are in a same position in time domain and on different carriers,the user is required to have a capability of simultaneously performingsending on a plurality of carriers, and the multicarrier sendingcapability supports a band combination of a carrier 1 and a carrier 2.

If the time-frequency resource of the resource grant 1 and thetime-frequency resource of the resource grant 2 are in differentpositions in time domain and on different carriers, the user may supportsending of the resource grant 1 and the resource grant 2 throughswitching a single-carrier transmitter to different carriers, but thisrequires a time interval between the time-frequency resources that areselected on the resource grant 1 and the resource grant 2 to besufficiently long, to meet switching delay requirements of the user ondifferent carriers.

If the time-frequency resource of the resource grant 1 and thetime-frequency resource of the resource grant 2 are on a same carrier,the UE needs to determine that the resource grant 1 and the resourcegrant 2 meet a peak-to-average ratio requirement.

It should be further noted that, the foregoing first preset criterionand the conflict determining may further cause a case in which nosuitable resource is selected finally, and then the following processingneeds to be performed:

skipping the target data when no resource of the target carrier meetsthe first preset criterion; and

skipping a logical channel to which the target data belongs, and/or atarget address to which the target data belongs.

A processing flow in this embodiment is further described below withreference to FIG. 2. UE performs the following steps in each time unitto perform resource selection:

Step 201: Initialize an existing resource grant as an invalid resourcegrant, and initialize a valid resource grant set to be empty.

Step 202: A user checks whether there is data to be transmittedcurrently, and if yes, performs step 203; otherwise, exits.

Step 203: Select target data in to-be-transmitted data, and initialize afirst carrier set as a carrier set corresponding to a service to which atarget address belongs and a highest data packet priority.

The selecting target data in to-be-transmitted data may include:according to a logical channel prioritization criterion, preferentiallyselecting a target address having a highest data packet priorityassociated with a logical channel including to-be-transmitted data, andpreferentially selecting, at the target address, to-be-transmitted datahaving a highest data packet priority.

Step 204: Determine whether there is an invalid resource grant in thefirst carrier set, for example, determine whether there is an existinginvalid resource grant in the current first carrier set, and if yes,perform step 205, and if not, perform step 206.

Step 205: Determine whether the currently existing invalid resourcegrant meets conditions of carrier reselection and/or resourcereselection, and if yes, perform step 206, and if not, directly use theresource grant, and perform step 208.

Step 206: Perform carrier selection according to a first presetcriterion, select a target resource on a selected carrier, and generatea resource grant for the selected target resource on the target carrier,and if the resource grant can be generated, perform step 207; or if theresource grant is not generated, skip current data.

The performing carrier selection according to a first preset criterionincludes: performing carrier selection based on CBR measurement valuesof carriers in the first carrier set. For example, the user selects acarrier having a CBR less than a specific threshold, where the thresholdvaries for different PPPPs; or the user selects a carrier having asmallest CBR, and when there is an invalid resource grant, a CBRmeasurement value of the target carrier is less than a preset offset ofa current carrier measurement value; otherwise, the user maintains acarrier in which the current invalid resource grant is locatedunchanged.

The performing carrier selection according to a first preset criterionmay further include:

a CBR measurement value of the target carrier being less than athreshold;

the target carrier being capable of carrying a data packet priority PPPPvalue of the target data;

the target carrier being capable of carrying a service of the targetdata; and

a CBR value of the target carrier being less than a current CBRmeasurement value and a CBR threshold corresponding to the data packetpriority PPPP value of the current target data.

The performing carrier selection according to a first preset criterionmay further include: selecting, for low-priority data, a first resourcegrant on a first carrier, and subsequently selecting, for high-prioritydata, a second resource grant on a second carrier; determining whetherthe first resource grant and the second resource grant are in conflict;and if the second resource grant is in conflict with the first resourcegrant, preferentially transmitting the second resource grant, anddiscarding the first resource grant.

Alternatively, a first resource grant on a first carrier may be selectedfor high-priority data, and subsequently a second resource grant that ison a second carrier and is not in conflict with the first resource granton the first carrier may be selected for low-priority data.

Specifically, the determining whether the two resource grants are inconflict includes:

if a time-frequency resource of a resource grant 1 and a time-frequencyresource of a resource grant 2 are in a same position in time domain andon different carriers, the user is required to have a capability ofsimultaneously sending on a plurality of carriers, and the multicarriersending capability supports a band combination of a carrier 1 and acarrier 2;

if the time-frequency resource of the resource grant 1 and thetime-frequency resource of the resource grant 2 are in differentpositions in time domain and on different carriers, the user may supportsending of the resource grant 1 and the resource grant 2 throughswitching a single-carrier transmitter to different carriers, but thisrequires a time interval between the time-frequency resources that areselected on the resource grant 1 and the resource grant 2 to besufficiently long, to meet switching delay requirements of the user ondifferent carriers; and

if the time-frequency resource of the resource grant 1 and thetime-frequency resource of the resource grant 2 are on a same carrier,the UE needs to determine that the resource grant 1 and the resourcegrant 2 meet a peak-to-average ratio requirement.

When a resource grant can be generated for the target carrier, theresource grant is determined to be used, and a MAC PDU is generated;otherwise, the target carrier is removed from the first carrier set. Aspecific process is: if a resource grant can be generated, determiningthat the resource grant is to be used, and performing step 208;otherwise, removing the target carrier from the first carrier set.

For the skipping current data, the skipping the target data means thatfor a current time, no resource is selected for a logical channel towhich the target data belongs, and/or a target address to which thetarget data belongs; however, resources may still be selected for otherlogical channels than the logical channel to which the target databelongs, and/or other target addresses than the target address to whichthe target data belongs for transmission, even if the other logicalchannels than the logical channel to which the target data belongs,and/or the other target addresses than the target address to which thetarget data belongs have priorities less than a priority of the logicalchannel to which the target data belongs, and/or the target address towhich the target data belongs.

Step 207: Mark the used resource grant as a valid resource grant,generate a MAC PDU, and remove related data from a cache.

The determining whether to remove the target carrier from the firstcarrier set may be understood as: when no available resource is found ona carrier, the carrier may be removed.

Further, a basis may be, for example, determining that the targetcarrier is to be removed from the carrier set if a quantity of validresource grants on a current carrier is greater than or equal to a CBRthreshold, where the (valid) resource grants on the current carrierreach or exceed a CBR limit; or removing the target carrier from thecarrier set if valid resource grants on a current carrier reach asupported resource grant quantity, where the (valid) resource grants onthe current carrier reach a resource grants quantity supportable by theuser, and subsequently, returning to step 202.

It can be seen that, by using the foregoing technical solution, resourceselection can be performed for target data according to a priority ofthe target data, and then data transmission between UEs is performed ona selected resource of a carrier. In this way, a problem of how toreceive and transmit data when UE performs multicarrier datatransmission can be resolved.

Embodiment 2

This embodiment of the present invention provides UE. As shown in FIG.3, the UE includes:

a processing unit 31, configured to select, for target data, a resourceon a target carrier according to a first preset criterion, where thefirst preset criterion includes at least: preferentially selecting theresource for high-priority target data; and a communications unit 32,configured to perform data transmission between UEs based on theselected resource of the target carrier.

There may be at least one piece of target data. That is, there may be aplurality of pieces of target data, and a quantity of the target data isnot described in detail herein.

Further, a manner of determining a priority of the target data mayinclude at least one of the following:

for two logical channels for which a PDCP copy operation is performed,data of a first logical channel is used as higher-priority data, anddata of a second logical channel is used as lower-priority data;

data corresponding a target address including a logical channelassociated with a high data packet priority PPPP has a high priority;and

at the target address, data corresponding to the logical channelassociated with the high data packet priority PPPP has a high priority.

Specifically, the high priority may be represented by using PPPP, thatis, a lower PPPP value represents a higher priority.

The high priority may be represented by using copying/non-copying data.That is, for a specific bearer for performing a PDCP copy operation(that is, the bearer is divided into two logical channels, serving twoPDCP PDU copies of the bearer). Only after to-be-transmitted data of onelogical channel is completely allocated, data is allocated to the otherlogical channel. The UE determines a first logical channel and a secondlogical channel in the two logical channels. Priorities of the twological channels may be determined according to whether there isto-be-transmitted data in a logical channel. For example, a logicalchannel in which there is to-be-transmitted data may be defined as ahigh-priority logical channel; otherwise, a logical channel may bedefined as a low-priority logical channel.

That is, after a user allocates a first carrier set to to-be-transmitteddata of one logical channel having a high priority, the user mayallocate, from carriers outside the first carrier set, a carrier toto-be-transmitted data of the other logical channel having a lowpriority.

That the target address of a high-priority logical channel correspondsto high-priority data may be determined according to priorities ofdifferent target addresses. In addition, at each target address, theremay be logical channels having different priorities. A priority oftarget data is determined based on a priority of a logical channel.

In that data corresponding a target address including a logical channelassociated with a high data packet priority PPPP has a high priority, alogical channel associated with a data packet priority means that eachlogical channel is associated with one data packet priority value PPPP.Such an association relationship is determined by the UE, and differentlogical channels may be associated with a same PPPP. The high datapacket priority PPPP means that a lower PPPP value represents a higherpriority.

When carrier selection is performed, a carrier is selected according toa particular condition. The first preset criterion further includes atleast one of the following:

a CBR measurement value of the target carrier being less than athreshold;

the target carrier being capable of carrying a data packet priority PPPPvalue of the target data;

the target carrier being capable of carrying a service of the targetdata;

a CBR value of the target carrier being less than a current CBRmeasurement value and a CBR threshold corresponding to the data packetpriority PPPP value of the current target data; and a quantity ofresource grants on the target carrier being less than a resource grantquantity threshold.

Certainly, there may be other criteria, which are not enumerated in thisembodiment.

Further, the processing unit 31 selects, for low-priority data, a firstresource on a first carrier, and subsequently selects, for high-prioritydata, a second resource on a second carrier; determines whether thefirst resource and the second resource are in conflict; and if thesecond resource is in conflict with the first resource, preferentiallytransmits the second resource, and discards the first resource.

That is, a sequence of resource allocation performed on high-priority orlow-priority target data may be set according to an actual situation.The manner described above is a manner in which the low-priority data isallocated a resource first and then the high-priority data is allocateda resource. In this manner, whether the two resources are in conflictneeds to be further determined. If the two resources are in conflict, alow-priority resource needs to be discarded, and a high-priorityresource is transmitted.

Another manner is: the processing unit 31 selecting, for high-prioritydata, a first resource on a first carrier, and subsequently selecting,for low-priority data, a second resource on a second carrier that is notin conflict with the first resource on the first carrier.

A method for determining whether the resources are in conflict mayinclude at least one of the following:

when the first resource on the first carrier and the second resource onthe second carrier are in a same position in time domain, and the firstcarrier and the second carrier are different, if a terminal device has amulticarrier sending capability, and the multicarrier sending capabilitysupports a band combination of the first carrier and the second carrier,determining that the first resource and the second resource are not inconflict;

when the first resource on the first carrier and the second resource onthe second carrier are in different positions in time domain, and thefirst carrier and the second carrier are different, if a time intervalbetween the first resource on the first carrier and the second resourceon the second carrier is greater than a preset time threshold,determining that the first resource and the second resource are not inconflict; and when the first resource on the first carrier and thesecond resource on the second carrier are on a same carrier, and atime-frequency resource of the first resource on the first carrier and atime-frequency resource of the second resource on the second carriermeet a preset peak-to-average ratio requirement, determining that thefirst resource and the second resource are not in conflict.

For example, assuming that the first resource is a resource grant 1, andthe second resource is a resource grant 2, if a time-frequency resourceof the resource grant 1 and a time-frequency resource of the resourcegrant 2 are in a same position in time domain and on different carriers,the user is required to have a capability of simultaneously performingsending transmitting on a plurality of carriers, and the multicarriersending capability supports a band combination of a carrier 1 and acarrier 2.

If the time-frequency resource of the resource grant 1 and thetime-frequency resource of the resource grant 2 are in differentpositions in time domain and on different carriers, the user may supportsending of the resource grant 1 and the resource grant 2 throughswitching a single-carrier transmitter to different carriers, but thisrequires a time interval between the time-frequency resources that areselected on the resource grant 1 and the resource grant 2 to besufficiently long, to meet handover switching requirements of the useron different carriers.

If the time-frequency resource of the resource grant 1 and thetime-frequency resource of the resource grant 2 are on a same carrier,the UE needs to determine that the resource grant 1 and the resourcegrant 2 meet a peak-to-average ratio requirement.

It should be further noted that, the foregoing first preset criterionand the conflict determining may further cause a case in which nosuitable resource is selected finally, and then the following processingneeds to be performed:

skipping the target data when no resource of the target carrier meetsthe first preset criterion; and

skipping a logical channel to which the target data belongs, and/or atarget address to which the target data belongs.

A processing flow in this embodiment is further described below. UEperforms the following steps in each time unit to perform resourceselection:

A processing unit 31 initializes an existing resource grant as aninvalid resource grant, and initializes a valid grant set to be empty.

A user checks whether there is data to be transmitted currently, and ifyes, performs step 203; otherwise, exits.

The processing unit 31 selects target data in to-be-transmitted data,and initializes a first carrier set as a carrier set corresponding to aservice to which a target address belongs and a highest data packetpriority.

The selecting target data in to-be-transmitted data may include:according to a logical channel prioritization criterion, preferentiallyselecting a target address having a highest data packet priorityassociated with a logical channel including to-be-transmitted data, andpreferentially selecting, at the target address, to-be-transmitted datahaving a highest data packet priority.

The processing unit 31 determines whether there is an invalid resourcegrant. For example, the processing unit 31 determines whether there isan existing invalid resource grant in the current first carrier set, andif yes, determines whether the currently existing invalid resource grantmeets conditions of carrier reselection and/or resource reselection, andif not, performs carrier selection based on CBR measurement values ofcarriers;

otherwise, directly uses the resource grant, generates a MAC PDU, andremoves the authorized resource from a cache.

The processing unit 31 determines whether the currently existing invalidresource grant meets conditions of carrier reselection and/or resourcereselection, and if yes, performs carrier selection based on CBRmeasurement values of carriers; otherwise, directly uses the resourcegrant; and if the resource grant is not directly used, marks a usedresource grant as a valid resource grant, generates a MAC PDU, andremoves related data from the cache.

The performing carrier selection based on CBR measurement values ofcarriers; otherwise, directly using the resource grant, generating a MACPDU, and removing the authorized resource from a cache is: performingcarrier selection based on CBR measurement values of carriers. Forexample, the user selects a carrier having a CBR less than a specificthreshold, where the threshold varies for different PPPPs; or the userselects a carrier having a smallest CBR, and when there is an invalidresource grant, a CBR measurement value of the target carrier is lessthan a preset offset of a current carrier measurement value; otherwise,the user maintains a carrier in which the current invalid resource grantis located unchanged.

The processing unit 31 performs carrier selection according to a firstpreset criterion, selects a target resource on a selected carrier, andgenerates a resource grant for the selected target resource on thetarget carrier; performs resource selection on the selected carrier, andgenerates resource grant, where the resource grant should not be inconflict with an grant in the valid resource grant set; and if theresource grant is not generated, skips current data.

The performing carrier selection according to a first preset criterionincludes: performing carrier selection based on CBR measurement valuesof carriers in the first carrier set. For example, the user selects acarrier having a CBR less than a specific threshold, where the thresholdvaries for different PPPPs; or the user selects a carrier having asmallest CBR, and when there is an invalid resource grant, a CBRmeasurement value of the target carrier is less than a preset offset ofa current carrier measurement value; otherwise, the user maintains acarrier in which the current invalid resource grant is locatedunchanged.

The performing carrier selection according to a first preset criterionmay further include:

a CBR measurement value of the target carrier being less than athreshold;

the target carrier being capable of carrying a data packet priority PPPPvalue of the target data;

the target carrier being capable of carrying a service of the targetdata; and

a CBR value of the target carrier being less than a current CBRmeasurement value and a CBR threshold corresponding to the data packetpriority PPPP value of the current target data.

The performing carrier selection according to a first preset criterionmay further include: selecting, for low-priority data, a first resourcegrant on a first carrier, and subsequently selecting, for high-prioritydata, a second resource grant on a second carrier; determining whetherthe first resource grant and the second resource grant are in conflict;and if the second resource grant is in conflict with the first resourcegrant, preferentially transmitting the second resource grant, anddiscarding the first resource grant.

Alternatively, a first resource grant on a first carrier may be selectedfor high-priority data, and subsequently a second resource grant that ison a second carrier and is not in conflict with the first resource granton the first carrier may be selected for low-priority data.

Specifically, the determining whether the two resource grants are inconflict includes:

if a time-frequency resource of a resource grant 1 and a time-frequencyresource of a resource grant 2 are in a same position in time domain andon different carriers, the user is required to have a capability ofsimultaneously sending on a plurality of carriers, and the multicarriersending capability supports a band combination of a carrier 1 and acarrier 2;

if the time-frequency resource of the resource grant 1 and thetime-frequency resource of the resource grant 2 are in differentpositions in time domain and on different carriers, the user may supportsending of the resource grant 1 and the resource grant 2 throughswitching a single-carrier transmitter to different carriers, but thisrequires a time interval between the time-frequency resources that areselected on the resource grant 1 and the resource grant 2 to besufficiently long, to meet switching delay requirements of the user ondifferent carriers; and

if the time-frequency resource of the resource grant 1 and thetime-frequency resource of the resource grant 2 are on a same carrier,the UE needs to determine that the resource grant 1 and the resourcegrant 2 meet a peak-to-average ratio requirement.

When a resource grant can be generated for the target carrier, theresource grant is determined to be used, and a MAC PDU is generated;otherwise, the target carrier is removed from the first carrier set. Aspecific process is: if a resource grant can be generated, determiningthat the resource grant is to be used; otherwise, removing the targetcarrier from the first carrier set.

For the skipping current data, the skipping the target data means thatfor a current time, no resource is selected for a logical channel towhich the target data belongs, and/or a target address to which thetarget data belongs; however, resources may still be selected for otherlogical channels than the logical channel to which the target databelongs, and/or other target addresses than the target address to whichthe target data belongs for transmission, even if the other logicalchannels than the logical channel to which the target data belongs,and/or the other target addresses than the target address to which thetarget data belongs have priorities less than a priority of the logicalchannel to which the target data belongs, and/or the target address towhich the target data belongs.

The processing unit 31 marks the used resource grant as a valid grant,generates a MAC PDU, and removes related data from the cache.

The determining whether to remove the target carrier from the firstcarrier set may be understood as: when no available resource is found ona carrier, the carrier may be removed.

Further, a basis may be, for example, determining that the targetcarrier is to be removed from the carrier set if a quantity of validresource grants on a current carrier is greater than or equal to a CBRthreshold, where the (valid) resource grants on the current carrierreach or exceed a CBR limit; or removing the target carrier from thecarrier set if valid resource grants on a current carrier reach asupported resource grant quantity, where the (valid) resource grants onthe current carrier reach a resource grant quantity supportable by theuser.

It needs to be understood that the solutions provided in this embodimentmay be mainly applied to a scenario shown in FIG. 4. In a mode 4, avehicle terminal uses a sensing+reservation transmission manner. Thevehicle terminal obtains an available transmission resource set in aresource pool through sensing. The terminal randomly selects an SL(bypass) resource from the set to transmit data. Because services in anInternet of Vehicles system have a periodicity feature, the terminalgenerally uses a semi-static transmission manner That is, afterselecting a transmission resource, the terminal continually uses theresource in a plurality of transmission cycles, thereby reducingprobabilities of resource reselection and resource conflict.

It can be seen that, by using the foregoing technical solution, resourceselection can be performed for target data according to a priority ofthe target data, and then data transmission between UEs is performed ona selected resource of a carrier. In this way, a problem of how toreceive and transmit data when UE performs multicarrier datatransmission can be resolved.

An embodiment of the present invention further provides a hardwarecomposition architecture of UE. As shown in FIG. 5, the UE includes atleast one processor 41, a memory 42, and at least one network interface43. All the components are coupled together by using a bus system 44. Itmay be understood that, the bus system 44 is configured to implementconnection and communication between the components. The bus system 44further includes a power supply bus, a control bus, and a status signalbus in addition to a data bus. However, for clear description, varioustypes of buses in FIG. 5 are marked as the bus system 44.

It may be understood that the memory 42 in this embodiment of thepresent invention may be a volatile memory or a nonvolatile memory, ormay include a volatile memory and a nonvolatile memory.

In some implementations, the memory 42 stores the following elements: anexecutable module or a data structure, or a subset thereof, or anextended set thereof:

an operating system 421 and an application program 422.

The processor 41 is configured to process the method steps inEmbodiment 1. Details are not described herein again.

An embodiment of the present invention provides a computer storagemedium. The computer storage medium stores a computer executableinstruction, and when executed, the computer executable instructionimplements the method steps in Embodiment 1.

When the foregoing apparatus in the embodiments of the present inventionis implemented in a form of a software functional module and sold orused as an independent product, the apparatus may alternatively bestored in a computer-readable storage medium. Based on such anunderstanding, the technical solutions of the embodiments of the presentinvention essentially, or the part contributing to the prior art may beimplemented in a form of a software product. The computer softwareproduct is stored in a storage medium and includes several instructionsfor instructing a computer device (which may be a personal computer, aserver, a network device, or the like) to perform all or some of themethods described in the embodiments of the present invention. Theforegoing storage medium includes: any medium that can store programcode, such as a USB flash drive, a removable hard disk, a read-onlymemory (ROM), a magnetic disk, or a compact disc. In this way, theembodiments of the present invention are not limited to any specificcombination of hardware and software.

Correspondingly, an embodiment of the present invention further providesa computer storage medium storing a computer program, and the computerprogram is configured to perform a data scheduling method in thisembodiment of the present invention.

Although preferred embodiments of the present invention are disclosedfor an exemplary objective, a person skilled in the art may be aware ofvarious possible modifications, additions, and replacements. Therefore,the scope of the present invention shall not be limited to the foregoingembodiments.

What is claimed is:
 1. A method for resource allocation, applied to userequipment (UE), the method comprising: selecting, from sidelink logicalchannels belonging to a target address, a sidelink logical channel withhigh priority, wherein the priority of the logical channel is associatedwith a ProSe Per Packet Priority (PPPP) and the logical channel withhigh priority is associated with high PPPP; allocating resources fordata in the sidelink logical channel with the high priority; determiningwhether there is a resource grant; when there is a resource grant,determining whether the resource grant meets conditions of carrierreselection and/or resource reselection; and when there is no resourcegrant, performing carrier selection based on channel busy ratio (CBR)measurement values of the carriers.
 2. The method according to claim 1,wherein the target address is a Destination having the sidelink logicalchannel with the high priority.
 3. The method according to claim 1,wherein the allocated resources are associated with a target carrier. 4.The method according to claim 3, wherein a CBR measurement value of thetarget carrier is below a threshold.
 5. The method according to claim 3,wherein the target carrier is allowed to carry a service of the data. 6.The method according to claim 3, wherein the target carrier comprises afirst carrier and a second carrier, and wherein the method furthercomprises: after allocating, for data in the sidelink logical channelwith the high priority, a first resource on the first carrier,allocating, for data in the sidelink logical channel with low priority,a second resource on the second carrier that is not in conflict with thefirst resource on the first carrier.
 7. The method according to claim 6,further comprising: determining whether the first resource and thesecond resource are in conflict; and the determining whether the firstresource and the second resource are in conflict comprising at least oneof the following: when the first resource on the first carrier and thesecond resource on the second carrier are in a same position in timedomain, and the first carrier and the second carrier are different, andthe UE has a multicarrier sending capability, and the multicarriersending capability supports a band combination of the first carrier andthe second carrier, determining that the first resource and the secondresource are not in conflict; or when the UE does not have amulticarrier sending capability, or the multicarrier sending capabilitydoes not support a band combination of the first carrier and the secondcarrier, determining that the first resource and the second resource arein conflict; when the first resource on the first carrier and the secondresource on the second carrier are in different positions in timedomain, and the first carrier and the second carrier are different, if atime interval between the first resource on the first carrier and thesecond resource on the second carrier is greater than a preset timethreshold, determining that the first resource and the second resourceare not in conflict; or if a time interval between the first resource onthe first carrier and the second resource on the second carrier is lessthan or equal to a preset time threshold, determining that the firstresource and the second resource are in conflict; or when the firstresource on the first carrier and the second resource on the secondcarrier are on a same carrier, if a time-frequency resource of the firstresource on the first carrier and a time-frequency resource of thesecond resource on the second carrier meet a preset peak-to-averageratio requirement, determining that the first resource and the secondresource are not in conflict; or if a time-frequency resource of thefirst resource on the first carrier and a time-frequency resource of thesecond resource on the second carrier do not meet a presetpeak-to-average ratio requirement, determining that the first resourceand the second resource are in conflict.
 8. The method according toclaim 1, wherein the determining whether the resource grant meetsconditions of carrier reselection and/or resource reselection furthercomprises: when the conditions are met, performing carrier selectionbased on the CBR measurement values of the carriers; otherwise, usingthe resource grant, and generating a MAC PDU.
 9. The method according toclaim 8, wherein the performing carrier selection based on the CBRmeasurement values of the carriers comprises at least one of thefollowing: selecting a carrier having a CBR below a preset CBRthreshold, wherein the CBR threshold is associated with the PPPP; orselecting a carrier having a smallest CBR.
 10. The method according toclaim 9, further comprising: generating a resource grant for theselected target carrier.
 11. An apparatus in a communication device,comprising: a processor and a memory configured to store a computerprogram executable on the processor, wherein the processor is configuredto, when running the computer program, select, from sidelink logicalchannels belonging to a target address, a sidelink logical channel withhigh priority, wherein the priority of the logical channel is associatedwith a ProSe Per Packet Priority (PPPP) and the logical channel withhigh priority is associated with high PPPP; allocate resources for datain the sidelink logical channel with the high priority; determinewhether there is a resource grant; when there is a resource grant,determine whether the resource grant meets conditions of carrierreselection and/or resource reselection; and when there is no resourcegrant, perform carrier selection based on channel busy ratio (CBR)measurement values of the carriers.
 12. The apparatus according to claim11, wherein the target address is a Destination having the sidelinklogical channel with the high priority.
 13. The apparatus according toclaim 11, wherein the allocated resources are associated with a targetcarrier.
 14. The apparatus according to claim 13, wherein a CBRmeasurement value of the target carrier is below a threshold.
 15. Theapparatus according to claim 13, wherein the target carrier is allowedto carry a service of the data.
 16. The apparatus according to claim 13,wherein the target carrier comprises a first carrier and a secondcarrier, and wherein the processor is further configured to: afterallocating, for data in the sidelink logical channel with the highpriority, a first resource on the first carrier, allocate, for data inthe sidelink logical channel with low priority, a second resource on thesecond carrier that is not in conflict with the first resource on thefirst carrier.
 17. The apparatus according to claim 16, wherein theprocessor is further configured to: determine whether the first resourceand the second resource are in conflict; and the determining whether thefirst resource and the second resource are in conflict comprising atleast one of the following: when the first resource on the first carrierand the second resource on the second carrier are in a same position intime domain, and the first carrier and the second carrier are different,and the communication device has a multicarrier sending capability, andthe multicarrier sending capability supports a band combination of thefirst carrier and the second carrier, determining that the firstresource and the second resource are not in conflict; or when thecommunication device does not have a multicarrier sending capability, orthe multicarrier sending capability does not support a band combinationof the first carrier and the second carrier, determining that the firstresource and the second resource are in conflict; when the firstresource on the first carrier and the second resource on the secondcarrier are in different positions in time domain, and the first carrierand the second carrier are different, if a time interval between thefirst resource on the first carrier and the second resource on thesecond carrier is greater than a preset time threshold, determining thatthe first resource and the second resource are not in conflict; or if atime interval between the first resource on the first carrier and thesecond resource on the second carrier is less than or equal to a presettime threshold, determining that the first resource and the secondresource are in conflict; or when the first resource on the firstcarrier and the second resource on the second carrier are on a samecarrier, if a time-frequency resource of the first resource on the firstcarrier and a time-frequency resource of the second resource on thesecond carrier meet a preset peak-to-average ratio requirement,determining that the first resource and the second resource are not inconflict; or if a time-frequency resource of the first resource on thefirst carrier and a time-frequency resource of the second resource onthe second carrier do not meet a preset peak-to-average ratiorequirement, determining that the first resource and the second resourceare in conflict.
 18. The apparatus according to claim 11, wherein theprocessor is further configured to: when the conditions are met, performcarrier selection based on the CBR measurement values of the carriers;otherwise, use the resource grant, and generate a MAC PDU.
 19. Theapparatus according to claim 18, wherein the processor is furtherconfigured to: select a carrier having a CBR below a preset CBRthreshold, wherein the CBR threshold is associated with the PPPP; orselect a carrier having a smallest CBR.
 20. The apparatus according toclaim 19, wherein the processor is further configured to: generate aresource grant for the selected target carrier.